(C) 1996 AROS - The Amiga Replacement OS


NAME
#include <utility/date.h>
#include <proto/utility.h>
ULONG CheckDate()
SYNOPSIS
struct ClockData * date

LOCATION
In UtilityBase at offset 22
FUNCTION
Examine the date described in the ClockData structure and determine whether it is a valid date. In particular this checks whether the ranges of the fields are within normal limits.

This function does not check whether the wday field of the ClockData structure is valid.

INPUTS
date
A ClockData structure desribing the date to check.
RESULT
If the date is valid, the number of seconds from midnight 1-Jan-1978 AD to the date, or 0 if the date is invalud.

NOTES
The date 01-Jan-78 00:00:00 is actually returned as invalid.

This also assumes that the ClockDate refers to a date in the Gregorian calendar. (60 sec/min, 60 min/hour, 24 hr/day, 12 months/year).

EXAMPLE
BUGS
Does not check whether the 29/2 is valid outside of a leap year.

SEE ALSO
Amiga2Date(), Date2Amiga()
INTERNALS
Since all the values are unsigned, we don't have to check for < 0 in fields which range from 0 ... n.

HISTORY
03.02.1997 ldp
Changed <proto/*_protos.h> to <proto/*.h>
02.02.1997 iaint
Some bug fixes, math functions and native Amiga support
27.01.1997 ldp
Polish
08.01.1997 iaint
A few more utility.lib functions